<script setup>
	import {
		biz,
	} from "@/config/index.js"
	const props = defineProps(['current'])
	const handleClick = (name) => {
		if (name === 'people') {
			uni.showLoading({
				complete: () => {
					window.location.href =
						'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=' + biz +
						'&scene=107#wechat_redirect'
				}
			})
			setTimeout(() => {
				uni.hideLoading()
			})
			return
		}
		uni.redirectTo({
			url: '/pages/tabBar/' + name
		})
	}
</script>

<template>
	<view>
		<uv-tabbar placeholder activeColor='#1989fa' fixed zIndex='10' safeAreaInsetBottom class="page-wrap"
			:customStyle="{width: 'auto',minWidth: '640rpx',maxWidth: '750rpx',margin:  '0 auto',}">
			<uv-tabbar-item :class='[{actived:props.current==0}]' text="首页" icon="home" @click='handleClick'
				name="home"></uv-tabbar-item>
			<uv-tabbar-item :class='[{actived:props.current==1}]' text="我的纪念馆" icon="empty-permission"
				@click='handleClick' name="my"></uv-tabbar-item>
			<uv-tabbar-item :class='[{actived:props.current==2}]' text="创建纪念馆" icon="plus-circle-fill"
				@click='handleClick' name="create"></uv-tabbar-item>
			<uv-tabbar-item :class='[{actived:props.current==3}]' text="公众号" icon="empty-favor" @click='handleClick'
				name="people"></uv-tabbar-item>
			<uv-tabbar-item :class='[{actived:props.current==4}]' text="个人中心" icon="account" @click='handleClick'
				name="user"></uv-tabbar-item>
		</uv-tabbar>
	</view>
</template>

<style lang="scss" scoped>
	.icon {
		width: 36rpx;
		height: 36rpx;
	}

	::v-deep .uv-tabbar-item__icon {
		width: unset;
	}

	::v-deep .actived {

		.uv-icon__icon,
		.uv-tabbar-item__text {
			color: #1989fa !important;
		}
	}
</style>